1. Field of the Invention
The present invention relates to control of a recording medium conveying mechanism of a recording apparatus which produces records with recording heads and conveys a recording medium in a predetermined amount by means of a DC motor.
2. Related Background Art
Ink-jet recording apparatus, which are mounted on printers, facsimiles and copiers, are widely used as means for recording images (including characters and symbols) on recording media, such as paper and plastic thin sheet (OHP), based on image information.
There is shown in FIG. 8 a schematic structural view of the recording medium conveying unit of one example of the above described ink-jet recording apparatus.
A recording medium 201 is supported by a conveying roller 202 placed in a recording section and conveyed in the direction shown by the arrow xcex1 in the figure by the conveying roller 202 when driving a conveying motor 203. As the conveying motor 203, a stepping motor or a DC motor is used. Nowadays, however, a DC motor is used more often because of its quietness, etc. When using a DC motor, a rotary encoder, not shown in the figure, is installed in the conveying roller 202 and the conveying motor 203 is controlled based on encoder signals sent from the encoder.
In front of the conveying roller 202, shafts 204 are provided in parallel therewith. And a carriage 205 performs a reciprocating motion on the shafts 204 in the direction shown by the arrow xcex2 when the drive action of a carriage motor 206 is transmitted to the carriage 205 via a belt 207. Between the shafts 204 and the carriage 205, lubricating oil such as grease is applied so as to decrease the mechanical loading caused due to the friction between them. As the carriage motor 206, a stepping motor or a DC motor is used, like the conveying motor 203. Nowadays, however, a DC motor is used more often because of its quietness, etc. When using a DC motor as the carriage motor 206, a linear encoder, not shown in the figure, is arranged on the carriage 205 and a linear encoder scale, not shown in the figure, is arranged in parallel with the shafts 204. And the carriage motor 206 is controlled based on signals obtained from the linear encoder.
The carriage 205, as means for moving recording heads, is mounted with recording heads 208 and tanks 209 which contain recording ink. The recording heads 208 shown in FIG. 8 are for use in producing color images, and a head for black 208-BK, a head for cyan 208-C, a head for magenta 208-M and a head for yellow 208-Y are arranged in this order in a scan direction of the carriage 205. And tanks 209-BK, 209-C, 209-M, 209-Y for respective black (BK), cyan (C), magenta (M) and yellow (Y) supply the inks to the heads corresponding to the respective colors. On the front surface of each recording head 208, that is, on a surface which faces the recording area of the recording medium 201 spaced at a fixed distance (eg. 0.8 mm) apart therefrom, an ink ejection portion is provided in which multiple (for example, 48 or 64) ink ejection orifices are arranged in a column in the direction intersecting the scanning direction of the carriage.
A control unit containing a control circuit (CPU) of the recording apparatus and ROM and RAM, all of which are not shown in the figure, receives information on a recording mode and recording data from a controller of an external host computer via, for example, the interface. And the control unit controls each recording head via head driving circuits and the driving sources such as various types of motors, based on the received information and data, whereby ink, etc. is ejected and records are produced on the recording medium 201.
As a method of controlling motor torque when using a DC motor for each of the carriage motor and the conveying motor, one is known in which an enable signal, which controls on/off of motor driver output, and phase signal, which controls the direction of motor rotation, are subjected to PWM (Pulse Width Modulation) control.
The relationships between the motor supply torque and the control waveform (duty factor DUTY) at the time of subjecting the enable signal to PWM control are shown in FIGS. 9A to 9C and those at the time of subjecting the phase signal to PWM control are shown in FIGS. 10A to 10C, respectively. The enable signal determines on/off of the output directed to the motors; for example, when the enable signal is low, output is disabled and when the enable signal is high, output is enabled. As shown in FIGS. 9A to 9C, when high level duty factor of the waveform is 0%, the motor supply torque output is 0%, when the duty factor 50%, the torque output 50%, and when the duty factor 100%, the torque output 100%, provided that the maximum output torque of the motors is 100%.
On the other hand, the phase signal determines the direction of motor rotation; for example, when the phase signal is low, the motor rotates in the reverse direction and when the phase signal is high, the motor rotates in the forward (or normal) direction. As shown in FIGS. 10A to 10C, when the high level duty factor of the waveform is 50%, the motor generates the same magnitude of torque in the forward and reverse directions, and therefore, is in the stopped state. In other words, when the high level duty factor of the waveform is 50%, the motor supply torque generated is 0%, when the duty factor is 75% (duty factor 25%), the torque generated is 50% in the forward direction (50% in the reverse direction), and when the duty factor is 100% (duty factor 0%), the torque generated is 100% in the forward direction (100% in the reverse direction).
Then, a control flowchart when using a DC motor as the conveying motor is shown in FIG. 11. The control in a DC motor servo has been performed by software computing via CPU. The information required for the servo is obtained from the encoder signal, and the encoder signal is processed using hardware such as ASIC. The software reads the position and speed information obtained from the encoder signal at intervals of servo cycle, for example, of 1 ms and performs servo computing processing to control the DC motor. The stop position of the recording medium is detected by the hardware, such as ASIC, which sends an interrupt signal to the CPU, and this interrupt allows the software to know that the recording medium reaches the stop position. After the Start (s501), upon the occurrence of interrupt (s502), the software decides what the content of the interrupt is (s503). If the decision is that the interrupt is not stop position interrupt, the software performs regular interrupt handling corresponding to the content of the interrupt (s504). If the interrupt is decided to be stop position interrupt, the software sets PWM output for stop and drives accordingly (s505), and then resets the interrupt (s506). Then the software verifies the stop position (s507); and, if the stop position is out of position, the stop position is corrected (s508). After verifying the stop position, a recording operation (s509) is executed and the control is completed (s510).
However, in the motor control of the prior art described above, the motor does not stop until multiple steps, that is, occurrence of interrupt, decision of the content of interrupt and setting/execution of PWM output for stop are executed after the recording medium reaches the stop position. Since the conveying motor continues to operate during the execution of each of the above steps, a problem of lowering the stop position accuracy has sometimes arisen.
Further, in order to avoid causing variation in time of executing PWM output for stop due to the occurrence of waiting for the interrupt, it has been necessary to raise the priority of stop position interrupt to the highest.
Accordingly, an object of this invention is to provide a recording apparatus which enables the speed up of a stop operation control processing of a DC motor for use in conveying a recording medium and the improvement of the stop position accuracy of the recording medium.
Another object of this invention is to provide a recording apparatus which is independent of the priority of an interrupt process related to the stop position of a DC motor, and hence high in degree of design freedom.
Still another object of this invention is to provide a recording apparatus which includes conveying means for conveying a recording medium, a conveying motor for driving the conveying means, servo computing means for controlling the output directed to the conveying motor based on servo computing results obtained using software, position detecting means for detecting the position of the recording medium by counting the number of encoder signal edges, a stop position setting register for setting a stop position of the recording medium, position comparing means for comparing the position detected by the position detecting means with that set by the stop position setting register, and conveying motor output switching means for selectively switching the output from the servo computing means and the output from an output-for-stop setting register. The recording apparatus further includes a conveying mechanism control unit which performs a first processing and a second processing almost simultaneously, when it is detected by the position comparing means that the recording medium has reached the stop position. The first processing is to make invalid the output of the servo computing means by the conveying motor output switching means and make effective the output in accordance with the output-for-stop setting register. The second processing is to generate an auto stop interrupt to inform that the output in accordance with the output-for-stop setting register is made effective.
Another object of this invention is to provide a recording apparatus which includes conveying means for conveying a recording medium, a conveying motor for driving the conveying means, servo computing means for controlling the output directed to the conveying motor based on the servo computing results obtained using software, position detecting means for detecting the position of the recording medium by counting the number of the encoder signal edges, a stop position setting register for setting a stop position of the recording medium, a position comparing means for comparing the position detected by the position detecting means with that set by the stop position setting register, and conveying motor output switching means for selectively switching the output from the servo computing means and the output from an output-for-stop setting register. The recording apparatus further includes a conveying mechanism control unit in which when it is detected that the recording medium has reached the stop position by the position comparing means, and the conveying motor output switching means, the position comparing means generates an auto stop interrupt to inform that the output in accordance with the output-for-stop setting register is made effective, and make the output from the output-for-stop setting register effective a certain time after the occurrence of the auto stop interrupt.